"""
共享的pytest fixtures配置文件
"""
import os
import pytest
from pathlib import Path
import tempfile

@pytest.fixture(scope="session", autouse=True)
def setup_test_env():
    """设置测试环境变量"""
    os.environ["TESTING"] = "true"
    os.environ["CONFIG_PATH"] = "tests/assets/config"
    yield
    os.environ.pop("TESTING", None)
    os.environ.pop("CONFIG_PATH", None)

@pytest.fixture
def temp_dir():
    """创建临时目录，用于需要临时文件的测试"""
    with tempfile.TemporaryDirectory() as tmp_dir:
        yield Path(tmp_dir)